/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2013
 */

package com.gxuwz.byssxsys.model;

import javacommon.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;

import cn.org.rapid_framework.util.DateConvertUtils;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "prompt_message_record")
public class PromptMessageRecord extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "PromptMessageRecord";
	public static final String ALIAS_ID = "主键";
	public static final String ALIAS_PMRSENDER1 = "发送者";
	public static final String ALIAS_PMRRECEIVER2 = "接收者";
	public static final String ALIAS_PMRSENDER_DATE3 = "发送时间";
	public static final String ALIAS_PMRCONTENT4 = "信息内容";
	public static final String ALIAS_PMRPHONE5 = "电话号码";
	public static final String ALIAS_PMREMAIL6 = "接收者邮箱";
	public static final String ALIAS_PMRSTATUE7 = "是否发送成功。1-成功。0-失败(未发送)";
	public static final String ALIAS_PMRTYPE8 = "发送信息的类型，1-短信；2-邮件；3-短信和邮件";
	
	//date formats
	public static final String FORMAT_PMRSENDER_DATE3 = DATE_FORMAT;
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 主键       db_column: id 
     */ 	
	
	private java.lang.Integer id;
    /**
     * 发送者       db_column: p_m_r_sender1 
     */ 	
	@Length(max=60)
	private java.lang.String pmrsender1;
    /**
     * 接收者       db_column: p_m_r_receiver2 
     */ 	
	@Length(max=60)
	private java.lang.String pmrreceiver2;
    /**
     * 发送时间       db_column: p_m_r_sender_date3 
     */ 	
	
	private java.util.Date pmrsenderDate3;
    /**
     * 信息内容       db_column: p_m_r_content4 
     */ 	
	@Length(max=500)
	private java.lang.String pmrcontent4;
    /**
     * 电话号码       db_column: p_m_r_phone5 
     */ 	
	@Length(max=60)
	private java.lang.String pmrphone5;
    /**
     * 接收者邮箱       db_column: p_m_r_email6 
     */ 	
	@Email @Length(max=60)
	private java.lang.String pmremail6;
    /**
     * 是否发送成功。1-成功。0-失败(未发送)       db_column: p_m_r_statue7 
     */ 	
	
	private java.lang.Integer pmrstatue7;
    /**
     * 发送信息的类型，1-短信；2-邮件；3-短信和邮件       db_column: p_m_r_type8 
     */ 	
	
	private java.lang.Integer pmrtype8;
	//columns END


	public PromptMessageRecord(){
	}

	public PromptMessageRecord(
		java.lang.Integer id
	){
		this.id = id;
	}

	

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "id", unique = true, nullable = false, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getId() {
		return this.id;
	}
	
	@Column(name = "p_m_r_sender1", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public java.lang.String getPmrsender1() {
		return this.pmrsender1;
	}
	
	public void setPmrsender1(java.lang.String value) {
		this.pmrsender1 = value;
	}
	
	@Column(name = "p_m_r_receiver2", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public java.lang.String getPmrreceiver2() {
		return this.pmrreceiver2;
	}
	
	public void setPmrreceiver2(java.lang.String value) {
		this.pmrreceiver2 = value;
	}
	
	@Transient
	public String getPmrsenderDate3String() {
		return DateConvertUtils.format(getPmrsenderDate3(), FORMAT_PMRSENDER_DATE3);
	}
	public void setPmrsenderDate3String(String value) {
		setPmrsenderDate3(DateConvertUtils.parse(value, FORMAT_PMRSENDER_DATE3,java.util.Date.class));
	}
	
	@Column(name = "p_m_r_sender_date3", unique = false, nullable = true, insertable = true, updatable = true, length = 0)
	public java.util.Date getPmrsenderDate3() {
		return this.pmrsenderDate3;
	}
	
	public void setPmrsenderDate3(java.util.Date value) {
		this.pmrsenderDate3 = value;
	}
	
	@Column(name = "p_m_r_content4", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getPmrcontent4() {
		return this.pmrcontent4;
	}
	
	public void setPmrcontent4(java.lang.String value) {
		this.pmrcontent4 = value;
	}
	
	@Column(name = "p_m_r_phone5", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public java.lang.String getPmrphone5() {
		return this.pmrphone5;
	}
	
	public void setPmrphone5(java.lang.String value) {
		this.pmrphone5 = value;
	}
	
	@Column(name = "p_m_r_email6", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
	public java.lang.String getPmremail6() {
		return this.pmremail6;
	}
	
	public void setPmremail6(java.lang.String value) {
		this.pmremail6 = value;
	}
	
	@Column(name = "p_m_r_statue7", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getPmrstatue7() {
		return this.pmrstatue7;
	}
	
	public void setPmrstatue7(java.lang.Integer value) {
		this.pmrstatue7 = value;
	}
	
	@Column(name = "p_m_r_type8", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getPmrtype8() {
		return this.pmrtype8;
	}
	
	public void setPmrtype8(java.lang.Integer value) {
		this.pmrtype8 = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Pmrsender1",getPmrsender1())
			.append("Pmrreceiver2",getPmrreceiver2())
			.append("PmrsenderDate3",getPmrsenderDate3())
			.append("Pmrcontent4",getPmrcontent4())
			.append("Pmrphone5",getPmrphone5())
			.append("Pmremail6",getPmremail6())
			.append("Pmrstatue7",getPmrstatue7())
			.append("Pmrtype8",getPmrtype8())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof PromptMessageRecord == false) return false;
		if(this == obj) return true;
		PromptMessageRecord other = (PromptMessageRecord)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

